﻿@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_rootLayout.cshtml";
}
@await Html.PartialAsync("_pagingLayout")

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">分组管理</h3>
                <div class="box-tools">
                    <span name="opt-create" data-type="create" data-path="" class="label label-success option-hover">Create</span>
                </div>
            </div>
            <div class="box-body div-table-content">
                <div class="box-body" style="overflow-x: auto;">
                    <table id="table" class="table table-bordered table-hover">
                        <thead id="thead">
                            <tr>
                                <th style="width: 60px;">@Html.Label("Id")</th>
                                <th class="col-ins-name">@Html.Label("名称")</th>
                                <th class="col-ins-name">@Html.Label("描述")</th>
                                <th class="col-ins-name">@Html.Label("创建时间")</th>
                                <th style="width:160px;">@Html.Label("操作")</th>
                            </tr>
                        </thead>
                        <tbody id="tbody"></tbody>
                    </table>
                </div>
                <div class="pull-right">
                    <div id="nav"></div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/template" id="listTemplate">
    <% _.each(obj,function(item) {%>
    <tr>
        <td>
            <%=item.id%>
        </td>
        <td>
            <%=item.name%>
        </td>
        <td>
            <%=item.description%>
        </td>
        <td>
            <%=item.createTime%>
        </td>
        <td>
            <span data-type="edit" data-id="<%=item.id%>" class="label label-success option-hover">edit</span>&nbsp;<span data-type="delete" data-id="<%=item.id%>" class="label label-danger option-hover">delete</span>&nbsp;
        </td>
    </tr>
    <% });%>
</script>

<div class="modal fade in" id="createModel" style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">Create Group</h4>
            </div>
            <div class="modal-body">
                <div class="form-horizontal">
                    <div class="box-body">
                        <input id="txtGroupId" type="hidden" />
                        <div class="form-group">
                            <label class="col-sm-3 control-label">分组名称</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control" id="txtGroupName" placeholder="请输入分组名称...">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <select class="form-control" id="select_EnvironmentInfo">
                                    <option value="">&#x2014;&#x2014;选择环境&#x2014;&#x2014;</option>

                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <select class="form-control" id="select_Business">
                                    <option value="">&#x2014;&#x2014;选择业务&#x2014;&#x2014;</option>

                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <select class="form-control" id="select_Application">
                                    <option value="">&#x2014;&#x2014;选择应用程序&#x2014;&#x2014;</option>

                                </select>
                            </div>
                        </div>
                        <div id="host_group">
                            <div class="form-group ">
                                <div class="col-sm-3">
                                    <select class="form-control" name="select_host_key">
                                        <option value="">—主机属性</option>
                                        <option value="OS">操作系统</option>
                                        <option value="InnerIP">内网IP</option>
                                        <option value="OuterIP">外网IP</option>
                                        <option value="CPU">CPU</option>
                                        <option value="HardDiskSize">硬盘容量(GB)</option>
                                        <option value="RAM">内存容量(GB)</option>
                                        <option value="Status">运行状态</option>
                                        <option value="CreateTime">创建时间</option>
                                        <option value="ExpireTime">到期时间</option>
                                    </select>
                                </div>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" aria-describedby="basic-addon1" name="select_host_value">
                                </div>
                                <div class="col-sm-4">
                                    <div class="btn-group" role="group" aria-label="...">
                                        <button type="button" class="btn btn-default" name="button_add">+</button>
                                        <button type="button" class="btn btn-default" name="button_remove">X</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12" id="createErrorMsg" style="display: none;">
                            <div class="form-group has-error">
                                <label class="control-label" style=""><i class="fa fa-remove"></i><span style="padding-left:12px"></span></label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary" id="btnSubmit">Save changes</button>
            </div>
        </div>
    </div>
</div>

<environment include="Development">
    <script src="~/lib/underscore/underscore.js"></script>
    <script src="~/js/Group/index.js"></script>
</environment>

<environment exclude="Development">
    <script src="~/lib/underscore/underscore.min.js"></script>
    <script src="~/js/Group/index.min.js"></script>
</environment>
